home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
rettig.arc
/
TRSOURCE.EXE
/
CURDRIVE.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-10-22
|
1KB
|
40 lines
; Function: CURDRIVE.ASM
;
; By Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
;-------------------------------------------------------------
; SYNTAX: memvar = CURDRIVE()
;
; RETURNS: Current disk directory letter.
;---------------------------------------------------------------
INCLUDE EXTENDA.INC
DATASEG
CLpublic <CURDRIVE>
CLstatic <byte DRIVEBUFF << 2 DUP (0) >>>
CLfunc char CURDRIVE
CLcode
DOSREQ 19H ; Get current drive
ADD AL,'A' ; Convert to ASCII
PUSH BX
PUSH DS
MOV BX,SEG DRIVEBUFF
MOV DS,BX
MOV BX,OFFSET DRIVEBUFF
MOV [BX],AL
MOV AX,BX
MOV DX,DS
POP DS
POP BX
CLret DX,AX
;********************************************************
END